home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TPWENG / PUTDOUB.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-22  |  800b  |  36 lines

  1. {$N+}
  2. program PutDoub;
  3. uses PXEngine, WinCrt;
  4.  
  5. const TableName = 'Table';
  6.  
  7. var   PxErr: Integer;
  8.       TblHandle: TableHandle;
  9.       RecHandle: RecordHandle;
  10.       FldHandle: FieldHandle;
  11.       Doub: Double;
  12.  
  13. procedure PX(Code : integer);
  14. begin
  15.   writeln(PXErrMsg(Code));
  16. end;
  17.  
  18. begin
  19.   PX(PXWinInit('MyApp', pxShared));
  20.   Doub := 34567.0;
  21.  
  22.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  23.   PX(PXRecBufOpen(TblHandle, RecHandle));
  24.   PX(PXFldHandle(TblHandle, 'Numeric Field', FldHandle));
  25.  
  26.   (* Update value with Double value *)
  27.   PxErr := PXPutDoub(RecHandle, FldHandle, Doub);
  28.   if PxErr <> PxSuccess then
  29.     Writeln(PxErrMsg(PxErr))
  30.   else PX(PXRecUpdate(TblHandle, RecHandle));
  31.  
  32.   PX(PXRecBufClose(RecHandle));
  33.   PX(PXTblClose(TblHandle));
  34.   PX(PXExit);
  35. end.
  36.